
export default ({
    state: {
        status:"matching", //对战状态，matching匹配状态，playing对战状态，finished游戏结束（可以考虑加一个界面）
        opponent_username:"",
        opponent_photo:"",
        socket:"",
        a_id:"",
        b_id:"",
        rows:0,
        cols:0,
        player:"1",
        gameObject:null,
        loser:"none",//none没人输,all是平局，A是黑棋输，B是白棋输，当然要判断一下user_id 和 a_id b_id,重来的话就是更新loser和status
    },
    mutations: {
        updateStatus(state,status){
            state.status = status;
        },
        updateOpponent(state,opponent){
            state.opponent_username = opponent.username;
            state.opponent_photo = opponent.photo;
        },
        updateSocket(state,socket){
            state.socket = socket;
        },
        updateGame(state,game){
            state.a_id = game.a_id;
            state.b_id = game.b_id;
            state.rows = game.rows;
            state.cols = game.cols;
        },
        updatePlayer(state,player){
            state.player = player;
        },
        updateGameObject(state,gameObject){
            state.gameObject = gameObject;
        },
        updateLoser(state,loser){
            state.loser = loser;
        }
    },
    actions: {
        
    },
    modules: {
    } 
})
